<%@ page language="java" import="java.util.*" pageEncoding="UTF-8" contentType="text/html; charset=UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<html>
  <head>
    <title></title>
    <link rel="stylesheet" type="text/css" href="${path}/css/editTable.css">
    
    <script type="text/javascript">
    	function check(){
    		var name = document.getElementById("name").value;
     		if("" == name){
     			alert("请输入网关名称");
     			return false;
     		}
     		var upper_id = document.getElementById("upper_id").value;
     		if("" == upper_id || "0" == upper_id){
     			alert("请选择上游名称");
     			return false;
     		}
    		var sp_number = document.getElementById("sp_number").value;
    		if("" == sp_number){
     			alert("请输入业务长号码");
     			return false;
     		}
     		var fee_type = document.getElementById("fee_type").value;
     		if("" == fee_type || "0" == fee_type){
     			alert("请选择计费类型");
     			return false;
     		}
     		var fee_code = document.getElementById("fee_code").value;
    		if("" == fee_code){
     			alert("请输入计费金额(分)");
     			return false;
     		}
    		var mobile = document.getElementById("mobile").value;
    		if("" == mobile){
     			alert("请输入手机号参数名");
     			return false;
     		}
    		var long_number = document.getElementById("long_number").value;
    		if("" == long_number){
     			alert("请输入长号码参数名");
     			return false;
     		}
    		var linkid = document.getElementById("linkid").value;
    		if("" == linkid){
     			alert("请输入唯一标识参数名");
     			return false;
     		}
    		var minute = document.getElementById("minute").value;
    		if("" == minute){
     			alert("请输入时长(分)参数名");
     			return false;
     		}
    		var second = document.getElementById("second").value;
    		if("" == second){
     			alert("请输入时长(秒)参数名");
     			return false;
     		}
    		var stime = document.getElementById("stime").value;
    		if("" == stime){
     			alert("请输入开始时间参数名");
     			return false;
     		}
    		var etime = document.getElementById("etime").value;
    		if("" == etime){
     			alert("请输入结束时间参数名");
     			return false;
     		}
    		var response = document.getElementById("response").value;
    		if("" == response){
     			alert("请输入返回内容参数名");
     			return false;
     		}
    	}
    </script>
  </head>
  <body>
    <div>
    	<form id="editGatewayForm" name="editGatewayForm" method="post" action="${path }/gateway/updateGateway.action" onsubmit="return check();">
    		<p>填写网关信息</p>
    		<c:choose>
    			<c:when test="${gatewayVo.id == null}">
    				<input type="hidden" name="gatewayVo.id" value="0" />
    			</c:when>
    			<c:otherwise>
    				<input type="hidden" name="gatewayVo.id" value="${gatewayVo.id }" />
    			</c:otherwise>
    		</c:choose>
    		<table>
    			<tr>
    				<td>网关名称</td>
    				<td>
    					<input type="text" id="name" name="gatewayVo.name" value="${gatewayVo.name }" />
    					<span style="color: red;size: 2px;">&nbsp;*必填项</span>
    				</td>
    			</tr>
    			<tr>
    				<td>网关详情</td>
    				<td>
    					<input type="text" id="detail" name="gatewayVo.detail" value="${gatewayVo.detail }" />
    				</td>
    			</tr>
    			<tr>
    				<td>上游名称</td>
    				<td>
    					<select id="upper_id" name="gatewayVo.upper_id">
    						<option value="0">--请选择--</option>
    						<c:if test="${partnerUpperVoList != null && fn:length(partnerUpperVoList) > 0 }">
    							<c:forEach items="${partnerUpperVoList }" var="partnerUpperVo" varStatus="i">
    								<option value="${partnerUpperVo.id }" <c:if test="${partnerUpperVo.id == gatewayVo.upper_id }">selected="selected"</c:if>>${partnerUpperVo.name }</option>
    							</c:forEach>
    						</c:if>
    					</select>
    					<span style="color: red;size: 2px;">&nbsp;*必选项</span>
    				</td>
    			</tr>
    			<tr>
    				<td>业务长号码</td>
    				<td>
    					<input type="text" id="sp_number" name="gatewayVo.sp_number" value="${gatewayVo.sp_number }" />
    					<span style="color: red;size: 2px;">&nbsp;*必填项</span>
    				</td>
    			</tr>
    			<tr>
    				<td>计费类型</td>
    				<td>
    					<select id="fee_type" name="gatewayVo.fee_type">
    						<option value="0">--请选择--</option>
    						<option value="1" <c:if test="${gatewayVo.fee_type eq 1 }">selected="selected"</c:if>>按时计费</option>
    						<option value="2" <c:if test="${gatewayVo.fee_type eq 2 }">selected="selected"</c:if>>按条计费</option>
    					</select>
    					<span style="color: red;size: 2px;">&nbsp;*必选项</span>
    				</td>
    			</tr>
    			<tr>
    				<td>计费金额(分)</td>
    				<td>
    					<input type="text" id="fee_code" name="gatewayVo.fee_code" value="${gatewayVo.fee_code }" />
    					<span style="color: red;size: 2px;">&nbsp;*必填项</span>
    				</td>
    			</tr>
    			<tr>
    				<td>手机号参数名</td>
    				<td>
    					<input type="text" id="mobile" name="gatewayVo.mobile" value="${gatewayVo.mobile }" />
    					<span style="color: red;size: 2px;">&nbsp;*必填项</span>
    				</td>
    			</tr>
    			<tr>
    				<td>长号码参数名</td>
    				<td>
    					<input type="text" id="long_number" name="gatewayVo.long_number" value="${gatewayVo.long_number }" />
    					<span style="color: red;size: 2px;">&nbsp;*必填项</span>
    				</td>
    			</tr>
    			<tr>
    				<td>唯一标识参数名</td>
    				<td>
    					<input type="text" id="linkid" name="gatewayVo.linkid" value="${gatewayVo.linkid }" />
    					<span style="color: red;size: 2px;">&nbsp;*必填项</span>
    				</td>
    			</tr>
    			<tr>
    				<td>时长(分)参数名</td>
    				<td>
    					<input type="text" id="minute" name="gatewayVo.minute" value="${gatewayVo.minute }" />
    					<span style="color: red;size: 2px;">&nbsp;*必填项</span>
    				</td>
    			</tr>
    			<tr>
    				<td>时长(秒)参数名</td>
    				<td>
    					<input type="text" id="second" name="gatewayVo.second" value="${gatewayVo.second }" />
    					<span style="color: red;size: 2px;">&nbsp;*必填项</span>
    				</td>
    			</tr>
    			<tr>
    				<td>开始时间参数名</td>
    				<td>
    					<input type="text" id="stime" name="gatewayVo.stime" value="${gatewayVo.stime }" />
    					<span style="color: red;size: 2px;">&nbsp;*必填项</span>
    				</td>
    			</tr>
    			<tr>
    				<td>结束时间参数名</td>
    				<td>
    					<input type="text" id="etime" name="gatewayVo.etime" value="${gatewayVo.etime }" />
    					<span style="color: red;size: 2px;">&nbsp;*必填项</span>
    				</td>
    			</tr>
    			<tr>
    				<td>返回内容参数名</td>
    				<td>
    					<input type="text" id="response" name="gatewayVo.response" value="${gatewayVo.response }" />
    					<span style="color: red;size: 2px;">&nbsp;*必填项</span>
    				</td>
    			</tr>
    			<tr>
    				<td colspan="2">
    					<input type="submit" name="submit" value="确认" />
    				</td>
    			</tr>
    		</table>
    	</form>
    </div>
  </body>
</html>